﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CrystalReportPrintLibrary;

namespace FreightForwarderTest
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();
            dialog.Filter = "*.rpt|*.rpt";
            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                textBox1.Text = dialog.FileName;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            CrystalReportPrintLibrary.PrintClass pr = new CrystalReportPrintLibrary.PrintClass();
            IList<Parameter> Pars = new List<Parameter>();
            Parameter Par = new Parameter();
            Par.ParameterName = "DocEntry";
            Par.ParemeterValue = textBox2.Text;
            Pars.Add(Par);
            CrystalReportPrintLibrary.OperateType type;
            if (comboBox1.SelectedText == "打印")
                type = OperateType.Print;
            else
                type = OperateType.Perview;
            pr.CrystalReportPrint(type, textBox2.Text, Pars);

        }

        private void button3_Click(object sender, EventArgs e)
        {
            ServiceReference1.PrintServiceClient client = new ServiceReference1.PrintServiceClient();
        }
    }
}
